Kafka Streams in Action: Real-Time Apps and Microservices With the Kafka Streams API by Bill Bejeck

Kafka Streams in Action: Real-Time Apps and Microservices With the Kafka Streams API by Bill Bejeck

Author:Bill Bejeck [Bejeck, Bill]
Language: eng
Format: epub
Tags: computers, internet, Web Programming, Technology & Engineering, Data Transmission Systems, Broadband, Languages, Java, Software Development & Engineering, General, Web Services & APIs
ISBN: 9781617294471
Google: lgl-swEACAAJ
Publisher: Manning
Published: 2018-09-16T23:39:50.714521+00:00


Figure 5.13. Creating session windows with inactivity periods and retention

With the call to windowedBy(SessionWindows.with(twentySeconds).until(fifteenMinutes)), you create a session window with an inactivity gap of 20 seconds and a retention period of 15 minutes. An inactivity time of 20 seconds means the application includes any record arriving within 20 seconds of the current session’s ending or start time within the current (active) session.

You then specify the aggregation operation to perform count, in this case, on the session window. If an incoming record falls outside the inactivity gap (on either side of the timestamp), the application creates a new session. The retention period maintains the session for the specified amount of time and allows for late-arriving data that’s outside the inactivity period of a session but can still be merged. Additionally, as sessions are combined, the newly created session uses the earliest timestamp and latest timestamp for the start and end of the new session, respectively.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.